UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CvFXph1CJq336sAk+f/hfhfP6Sp2rH6rs+LWm3bPujw=' 
WHERE 
  key_id = 'bea8a4802c1afb00e851c05ede0d6a592e5760b9b42f1b8cf75acefdf4fa24cf' 
  AND (
    token = 'CvFXph1CJq336sAk+f/hfhfP6Sp2rH6rs+LWm3bPujw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047