UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WguSDjB4oJO7iQhFbaztKy+zgQQ1OpSKFgr1Vxv99oU='
WHERE
key_id = 'da3fa6e3e3171d7a0e8a3957af2902c4eb45c0e779b9b651a2a3d55531150923'
AND (
token = 'WguSDjB4oJO7iQhFbaztKy+zgQQ1OpSKFgr1Vxv99oU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)