UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NH3p0S6mLSz3uVg/SMahu7KGW7G5zQEA0cCrCe9187E='
WHERE
key_id = '8d6057d8994d7e399fe00d9ea25173350d80d304ac6411fcef9719ca2805c4da'
AND (
token = 'NH3p0S6mLSz3uVg/SMahu7KGW7G5zQEA0cCrCe9187E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)