UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bnKR74l21ifvz75NPHJ24lVjU3cTL43uCjNJ/vKNJ9Q='
WHERE
key_id = 'caa5b9d6f0107bdf82cca9aa8ca89f9a617f4778ea3fb6f65094151710578432'
AND (
token = 'bnKR74l21ifvz75NPHJ24lVjU3cTL43uCjNJ/vKNJ9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)