UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9n+n9Yc7ak1GL2QWIUdVFHjsZkNmcAGoq4k1CGNCQ+k='
WHERE
key_id = 'e44b61b4267a8229075ad460c466cf91631b6106a4047a0af12d9ad9dd761365'
AND (
token = '9n+n9Yc7ak1GL2QWIUdVFHjsZkNmcAGoq4k1CGNCQ+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)