UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nmqhg/+De/iuHNDwbThsW6F4gAuTViW7vaEuoMJvVO0=' 
WHERE 
  key_id = 'c1876cb4354f13faea108a7ace9bb0fb58927943f199ad3d9c2a373c42d9bb04' 
  AND (
    token = 'nmqhg/+De/iuHNDwbThsW6F4gAuTViW7vaEuoMJvVO0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028