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