UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JaRCzdNvJ8g02z7620/85w/TzkQ1NYDnqYpFQaCsKdU=' 
WHERE 
  key_id = '57728e8b3baca2471448b40aa12da5ed6e16293b2f799b0b45cb939e903cb70e' 
  AND (
    token = 'JaRCzdNvJ8g02z7620/85w/TzkQ1NYDnqYpFQaCsKdU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041