UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bTN/raTEER0lUyO5LhKG07ogo6kOMMdv2r2DqbbPMuU=' 
WHERE 
  key_id = '6751ab9aa7958988e91f9045f260b6c4e31d448d5be36f148c10a0bab34f9c91' 
  AND (
    token = 'bTN/raTEER0lUyO5LhKG07ogo6kOMMdv2r2DqbbPMuU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047