UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WcMtd+LRtvX8BfIyMX1/RV1J0fr2rjH6772eAJqP6g4=' 
WHERE 
  key_id = '3d70afddde88a59e490fcbeaa7a0850f7309b27d1855c6badb5ec0d8058b4dea' 
  AND (
    token = 'WcMtd+LRtvX8BfIyMX1/RV1J0fr2rjH6772eAJqP6g4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027