UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VBF1LpNDLInjZ5tXqFoAGdQcQ/gIlrrq14lNhmYB9l8='
WHERE
key_id = '59116163f88d67d109a6bb0022555a60f75bbd2e60517f674beb949757d5f0f1'
AND (
token = 'VBF1LpNDLInjZ5tXqFoAGdQcQ/gIlrrq14lNhmYB9l8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)