UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VwuFF+o5ktJCPOGmc759u48uc+tqqLFbZjZaIyk/nWc=' 
WHERE 
  key_id = 'a2c2cc9b07466f7515504d599f7422c7608369256e47d29b2c1f9896cc269527' 
  AND (
    token = 'VwuFF+o5ktJCPOGmc759u48uc+tqqLFbZjZaIyk/nWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022