UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1V/4LmXyUATIX69TzfJ7Rs+Xwf3NJS258KAGYmMu7sQ=' 
WHERE 
  key_id = 'e0e89be14c88dc79af98ae9befbe16263536927976d6275847d7e8bf0c6a8d55' 
  AND (
    token = '1V/4LmXyUATIX69TzfJ7Rs+Xwf3NJS258KAGYmMu7sQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046