UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zIPYXUWBk+khpUeBC6q1Z1kM/wWMDpzlsOXO2TqwIkM=' 
WHERE 
  key_id = '2263c0eda17aedf31002faec6b4c0d314169967cfba3b72d416a4871b67b65a2' 
  AND (
    token = 'zIPYXUWBk+khpUeBC6q1Z1kM/wWMDpzlsOXO2TqwIkM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059