UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wfg17uC9MqU/vkUe4T/XSBQx8fAKvh81NRX4r+DBEMo='
WHERE
key_id = 'bd1491220173e471e438d1f4cb57be08e9d11a9d349162a49e142fe8cba5bdaf'
AND (
token = 'Wfg17uC9MqU/vkUe4T/XSBQx8fAKvh81NRX4r+DBEMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)