UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zXZ+h5JzdyT+SQb7oU+Qa7nDsOtr2zHffy7mBEceKO0=' 
WHERE 
  key_id = 'e8db8162b5d830e0b6f0814224b82d773b199062ca17a9e66247a47a6716d430' 
  AND (
    token = 'zXZ+h5JzdyT+SQb7oU+Qa7nDsOtr2zHffy7mBEceKO0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018