UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ZKwbLqXCXkE5qjnvtSYnHhjg/7pQF6vWUJfxaZGKtE='
WHERE
key_id = '09c96f27f9134803d0974c69eb5283b4b516e718aad2d7151c2af2299ffb098b'
AND (
token = '9ZKwbLqXCXkE5qjnvtSYnHhjg/7pQF6vWUJfxaZGKtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)