UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'koPKJt7fXAVFbGNiXX8ZFTuR7+iT+f0MZkNT8jHt/ys='
WHERE
key_id = '252af378063852b912a331e36725d17df1f9f3fb0a131fecde326eb4e3cbadd6'
AND (
token = 'koPKJt7fXAVFbGNiXX8ZFTuR7+iT+f0MZkNT8jHt/ys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)