UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JKgf2he/rJkKw402jtBeVjwFt8kHbB3Cp4hXReiB6IQ=' 
WHERE 
  key_id = '8f1e08d75b2f26a08339974403bbddda380ae856228c20039005c7f7974e9161' 
  AND (
    token = 'JKgf2he/rJkKw402jtBeVjwFt8kHbB3Cp4hXReiB6IQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031