UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'is0TKL95E2MfXvRpapC2Q6bHn5YEu++rN53WKJBnQ7Y='
WHERE
key_id = 'b305f214da8b2e8b8fdf05c9645f428063a75a38dcda95766da5d0b1703dad9a'
AND (
token = 'is0TKL95E2MfXvRpapC2Q6bHn5YEu++rN53WKJBnQ7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)