UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4BI43+EKeWBtCZ8oanMFCRgBIMGKusYlIbSmsDYg9pg='
WHERE
key_id = 'b5c29f03dfc7308842f04a3580dd33b233cfdfbfd5a05d398875f4f204996d8b'
AND (
token = '4BI43+EKeWBtCZ8oanMFCRgBIMGKusYlIbSmsDYg9pg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)