UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Re1YrepxavnBp4JTJQO/IPWpoIYYMPRYH83JBFu8RxY='
WHERE
key_id = 'fa8ac38c63acd00f6835b26fe6c38b24bd6e0c02345eba206bde3d92699f3014'
AND (
token = 'Re1YrepxavnBp4JTJQO/IPWpoIYYMPRYH83JBFu8RxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)