UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NqHPdE9CZRbSg/RPFhye7yX3Z6fs1KfaCK0T1OIYBOI=' 
WHERE 
  key_id = '0f8ea8261bb40a137ca3147eca36004f329e0770eb6a7b27b04a2b24c9f5ea4b' 
  AND (
    token = 'NqHPdE9CZRbSg/RPFhye7yX3Z6fs1KfaCK0T1OIYBOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047