UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WAMF33Q/vGjTr7RDW2ALJsQA5cGg5hUUHmtRSXvhGx8=' 
WHERE 
  key_id = '69a1eadc63c0523b33c5a0aa087c83cc774fef63f5a18413e1e90c586c66c031' 
  AND (
    token = 'WAMF33Q/vGjTr7RDW2ALJsQA5cGg5hUUHmtRSXvhGx8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036