UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+/NQQ9gsnwCmOqUCVj/W1Z5ZvvJTWID5WfLpDzewWcY='
WHERE
key_id = '489f5b93b7c4886f8eb578475dbbed3411686d6a20ed540e311201148e006eb4'
AND (
token = '+/NQQ9gsnwCmOqUCVj/W1Z5ZvvJTWID5WfLpDzewWcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)