UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mbBboSp6z1KCXg2gg0yy2TK34FJoMlkab/us0nZDBkQ=' 
WHERE 
  key_id = '388f46b9fe3ce33949bfd8445b69586bba91724b6a04ab4e00fede4245b3303a' 
  AND (
    token = 'mbBboSp6z1KCXg2gg0yy2TK34FJoMlkab/us0nZDBkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030