UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '91vJ08shT26iLh8XzrG+e8G97lOKIPz3ksM+Sy8CgKs='
WHERE
key_id = 'd0f44b5c90da0e8b9926fe612d512196682fbb69e74de9a791c076b3f5032170'
AND (
token = '91vJ08shT26iLh8XzrG+e8G97lOKIPz3ksM+Sy8CgKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)