UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0pFvLWVDNJbOWlJ6jo/i90PJ08z0cvXiy0RSFY8JKYI=' 
WHERE 
  key_id = '8ec69d2feac20345a126226510d4d1728162b82cb41d9b9bf69359d81a33fccd' 
  AND (
    token = '0pFvLWVDNJbOWlJ6jo/i90PJ08z0cvXiy0RSFY8JKYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038