UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HUaY55yTCpJ/VIZaoPoyTM+t8WftiG6K6f3/Qqh99bU=' 
WHERE 
  key_id = 'e2c0a6d4b259ae642ca57aed9b70f24502e17b2611701b4871222b0ca901eee3' 
  AND (
    token = 'HUaY55yTCpJ/VIZaoPoyTM+t8WftiG6K6f3/Qqh99bU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031