UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sysSra7qpZ7ci43SduoC74lAyFPYJadeb1mADoVoddk=' 
WHERE 
  key_id = '1d25e9cb93161da48f0d9b59d12544f46caa493a80eb7508bd2ae72ba74659aa' 
  AND (
    token = 'sysSra7qpZ7ci43SduoC74lAyFPYJadeb1mADoVoddk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013