UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EeN9/3wVOfbsK+v7s89iFZLlWW2PpmYh9MbHs+yNQRk='
WHERE
key_id = '6ac1b04e7c7e13b550c95e2849ddc348bccde22971e7de5aa7b18b916d6b623e'
AND (
token = 'EeN9/3wVOfbsK+v7s89iFZLlWW2PpmYh9MbHs+yNQRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)