UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4XUefT/XEzC51GJBlupKtveNF532pWbTv+therD2BY4='
WHERE
key_id = '1c92cb8a39778f4fd76c7511f86233461a1186daefa475671eb6d09c43c10165'
AND (
token = '4XUefT/XEzC51GJBlupKtveNF532pWbTv+therD2BY4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)