UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ZP4y+LrsHDJosOnecl/dlRXcSn32S9h/0sTcHt8KAs='
WHERE
key_id = '92cde4dc7ce20900f10f61ac9b9584f55495032ce2aa47fc4939286f38ea3df6'
AND (
token = '6ZP4y+LrsHDJosOnecl/dlRXcSn32S9h/0sTcHt8KAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)