UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iydZT74OCnBkrDePBHIoyhHq2Ssxsukm2Sf65Jz3o0s=' 
WHERE 
  key_id = '85b27419cba731eade7e4aaa722e1bdda1dfca6a3d0b0e6d867f1b0cc4dda268' 
  AND (
    token = 'iydZT74OCnBkrDePBHIoyhHq2Ssxsukm2Sf65Jz3o0s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026