UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zt9b6MelHgWs28wXGzazlaPK1lBhPlN9IjJpVTYECys='
WHERE
key_id = '68e62843fcecb4dac5a0d0bc71af04c6b27ef5529f2413a25197d12ff10b73ae'
AND (
token = 'zt9b6MelHgWs28wXGzazlaPK1lBhPlN9IjJpVTYECys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)