UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZFPLTbIxg+/AQlhz706mpZxe9maK5WitrOs3mQdCB9I='
WHERE
key_id = 'a4476ca6b77e9d08e01e7cd726520c32a9df7a29129813c4e5ec686dcaccb66c'
AND (
token = 'ZFPLTbIxg+/AQlhz706mpZxe9maK5WitrOs3mQdCB9I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)