UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5MzQvsrKj/1PyTZzS02+C6vTDbVfOC05J1D7yYT3KFE=' 
WHERE 
  key_id = '0ac13faddc78cc310181b48ad57567d0fd2eb84c9b9c5dc230632a54277c2063' 
  AND (
    token = '5MzQvsrKj/1PyTZzS02+C6vTDbVfOC05J1D7yYT3KFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016