UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CEVo3lx99xaqa828u3xAK3TyRQdw6wOFtpV4b9EHwC4='
WHERE
key_id = 'fb0e97a3d0384df2bc42b1e5d8d227b258a033049c46bb49e4e7e4ae65e5f467'
AND (
token = 'CEVo3lx99xaqa828u3xAK3TyRQdw6wOFtpV4b9EHwC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)