UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WlPGnIAYTxdGem+EbjdWknkLs4gRDtKa2Uw4zmsqWLA=' 
WHERE 
  key_id = '240fa0a87cb928c4e75112c7a9ab518edea20994240b1cfc3f4a1f4d3ec68c2a' 
  AND (
    token = 'WlPGnIAYTxdGem+EbjdWknkLs4gRDtKa2Uw4zmsqWLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028