UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'saJ6/zufs4c60ikJLc3s4GRIAJZa1tIke3WO6ZWTw2o=' 
WHERE 
  key_id = '7d6f872094f9b7d193d2ee39074b1db67af5b870d8a819805c1426853525cafe' 
  AND (
    token = 'saJ6/zufs4c60ikJLc3s4GRIAJZa1tIke3WO6ZWTw2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026