UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QEtTqQUHdZqyxANn20ScQs7P57eSiKvQhjcjpL/ZSXw='
WHERE
key_id = 'acd09cad2cf6e19d504d9d38d41b486e6ec6a381e5e31d6ce0ee560fd8db08f3'
AND (
token = 'QEtTqQUHdZqyxANn20ScQs7P57eSiKvQhjcjpL/ZSXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)