UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TPrr93DrHHsrO0rPyKfJ5mt3HzNnkU/GaGqab1b6I2M=' 
WHERE 
  key_id = '7c665be963efda4070563850cca613a92220d643fe28de88d58c282d226e99dc' 
  AND (
    token = 'TPrr93DrHHsrO0rPyKfJ5mt3HzNnkU/GaGqab1b6I2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030