UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UyhYjfD8e+S8Po1AoLQseJdaqrHhlcWvR8+BbWnqO/s=' 
WHERE 
  key_id = '416ad2140a609da4352ec6926df388dc9ca3209f6d76c33c59cd2b8ed55b4555' 
  AND (
    token = 'UyhYjfD8e+S8Po1AoLQseJdaqrHhlcWvR8+BbWnqO/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041