UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cwuZym1+pOVaB74zQVhKBLFB7eQLAPTOjD7UgB9VWnI='
WHERE
key_id = '1c1872f353909dcf95ba7347540c652588cbca3b1bb4de9ac24a07cb52c1f74f'
AND (
token = 'cwuZym1+pOVaB74zQVhKBLFB7eQLAPTOjD7UgB9VWnI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)