UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zQNdsUdb0qVG1mcUOYAe06vaLwVZTimzj1b8kLhu7HE=' 
WHERE 
  key_id = '2594761fddacb1a66066d0fa313862b2159a77bf2d0f02717a541f59e149fbba' 
  AND (
    token = 'zQNdsUdb0qVG1mcUOYAe06vaLwVZTimzj1b8kLhu7HE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022