UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LNk5psVzb+X+eyb3oiw74qBceErZH3bH0JGFf4GirdQ='
WHERE
key_id = '65c1882cc847fa53e73bbf3859006f968c1190ac83ffd28bb43a7916bd78ee00'
AND (
token = 'LNk5psVzb+X+eyb3oiw74qBceErZH3bH0JGFf4GirdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)