UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IrP8fWvzqx7VI/rGPc21J1WbQROCUi2mIccvMrhJeBc='
WHERE
key_id = '04d9a430780358fed1524cdbb66d3ccc5a544966c7e8314519d932ecaa330b52'
AND (
token = 'IrP8fWvzqx7VI/rGPc21J1WbQROCUi2mIccvMrhJeBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)