UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Gn+T+d9HdU7H8sXnM8dKymm+HS/PCfSsCniNX5pU8g=' 
WHERE 
  key_id = 'cfb9299b74bd255cb02d7f4128991c4d03317fcd6220cb09544454003fc6cba1' 
  AND (
    token = '+Gn+T+d9HdU7H8sXnM8dKymm+HS/PCfSsCniNX5pU8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035