UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HFPoh8YkS5B2crCvBM/yc0aHvBN9pbDnEPG3RB64QXc=' 
WHERE 
  key_id = '4f260575989bcc3b06a72e345c74291a79c966f17e4bb42c522d620422548e1f' 
  AND (
    token = 'HFPoh8YkS5B2crCvBM/yc0aHvBN9pbDnEPG3RB64QXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040