UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k7pIl0KMMFZOCFh//7ztrwkXI3sl5zEcEvwxM4NLWI4='
WHERE
key_id = '3606cbac4518b5ab7d8f4858d09237ea18df1192f3b449c30bec63e4eb0abb7f'
AND (
token = 'k7pIl0KMMFZOCFh//7ztrwkXI3sl5zEcEvwxM4NLWI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)