UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o7XceJaex5k+Z1uALb3lCp1ZrL4BOqYiv++uLYxOXLY=' 
WHERE 
  key_id = '485e7e1e816b266362cf7e253ec8c43421c1da767e28c86e66a9e5ebc6d41aff' 
  AND (
    token = 'o7XceJaex5k+Z1uALb3lCp1ZrL4BOqYiv++uLYxOXLY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039