UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SNpNJ9CUUe4+/kuTCwAP4+JEn7gUFEUuGU/bZTt2bUI=' 
WHERE 
  key_id = '68682b331af0e47c005d295d753658c5b68cf8aa3dea55441eed9068a40c9738' 
  AND (
    token = 'SNpNJ9CUUe4+/kuTCwAP4+JEn7gUFEUuGU/bZTt2bUI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054