UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hR9L8lKUAU8147lq2+nR/tQ+RTagXbJUOsQhb8uo2EI='
WHERE
key_id = '81ac4330b0523429f9744ec6d4170a247fe29a092504b712f74bace40d137b9c'
AND (
token = 'hR9L8lKUAU8147lq2+nR/tQ+RTagXbJUOsQhb8uo2EI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)